<?php 
echo "Student list:<br>"; 
include('Student.php'); 
$students = array(); 

 $first = new Student("Doe", "John","fershman"); 
 $first->add_email('home', 'john@doe.com'); 
 $first->add_email('work', 'jdoe@mcdonalds.com'); 
 $first->add_grade(65); 
 $first->add_grade(75); 
 $first->add_grade(55); 
 $first->add_status("freshman"); 
 $students['j123'] = $first;

 $second = new Student("Einstein", "Albert", "sophomore year"); 
$second->add_email('home', 'albert@braniacs.com'); 
$second->add_email('work1', 'a_einstein@bcit.ca'); 
$second->add_email('work2', 'albert@physics.mit.edu'); 
$second->add_grade(95); 
$second->add_grade(80); 
$second->add_grade(50); 
$second->add_status("Sophomore year");
$students['a456'] = $second;

$third = new Student("yihui", "yuan", "freshman"); 
$third->add_email('home', 'aslslds.com'); 
$third->add_email('work1', 'a_frffrfn@bcit.ca'); 
$third->add_email('work2', 'albgrglics.mit.edu'); 
$third->add_grade(85); 
$third->add_grade(87); 
$third->add_grade(58);
$third->add_status("freshman"); 
$students['y004'] = $third;


ksort($students); // one of the many sort functions 
foreach ($students as $student) 
 echo $student->toString(); 
?>